package control;

import client.Message;
import db.parking.beans.Complaints;
import db.parking.beans.Orders;

public class OrderController {
	
	private SimpleClient client;

	public OrderController(SimpleClient client)
	{
		this.client = client;
	}
	
	public void InsertOcassional(Orders bean) throws Exception
	{
		Message msg = new Message(bean,"AddOccasionalOrder");
		 try {
				client.sendToServer(msg);
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+" OrderControl->InsertOcassional");
		    }
	}
	
	public void InsertTemporary(Orders bean) throws Exception
	{
		Message msg = new Message(bean,"AddTemporaryOrder");
		 try {
				client.sendToServer(msg);
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+" OrderControl->InsertTemporary");
		    }
	}
	
	public void InsertSubscriber(Orders bean) throws Exception
	{
		Message msg = new Message(bean,"AddSOrder");
		 try {
				client.sendToServer(msg);
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+" OrderControl->InsertTemporary");
		    }
	}
	
	public void CancelOrder(Orders bean) throws Exception{
		Message msg = new Message(bean,"CancellOrder");
		 try {
				client.sendToServer(msg);
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+" OrderControl->CancelOrder");
		    }	
	}
	
	public void SubmitComplaint(Complaints bean) throws Exception{
		Message msg = new Message(bean,"SubmitComplaint");
		 try {
				client.sendToServer(msg);
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+" OrderControl->SubmitComplaint");
		    }	
	}
}
 